<!DOCTYPE html>
<html>
<head>
<title>13-02</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
.box { 
    background-color: blue; 
    width:50px; height:50px;
    position: absolute; top:20px; left:30px;  
}
@keyframes shake-box  {
    0% { transform: translateX(-20px); background-color:blue; }
    50% { transform: translateX(10px); background-color:yellow; }
    100% { transform: translateX(-20px); background-color:blue; }
}
.box:hover { 
    animation : shake-box 0.2s infinite;
}
</style>
</head>
<body>
    <div class="box"></div>
</body>
</html>